package com.wanxi.game;

public class GuessBigSmall {
    /**
     * 将猜大小按照面需对象的方式进行代码编写
     * 将猜大小定义多个对象
     * 1.输入对象 MyScanner
     * 2.随机数对象 MyRandom
     * 3.猜大小 GuessBigSmall
     */
    public static void main(String[] args) {
        int inNum = MyScanner.getNumSystemIn("请输入一个整数");
        int randomNum = MyRandom.getRandomNum(1, 100);
        judge(randomNum, inNum);
    }

    private static void judge(int randomNum, int num) {
        if (randomNum > num) {
            System.out.println("你猜小了");
        } else if (randomNum < num) {
            System.out.println("你猜大了");
        } else {
            System.out.println("你猜中了");
        }
    }
}
